/*
 * Copyright 2002-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.nanhill.commons.id;

import org.nanhill.commons.id.DefaultIdentifierGeneratorFactory;
import org.nanhill.commons.id.LongIdentifierGenerator;
import org.nanhill.commons.id.serial.LongGenerator;



/**
 * <p>A custom IdentifierGeneratorFactory used by {@link IdentifierGeneratorFactoryTest}.</p>
 *
 * <p>Extends {@link DefaultIdentifierGeneratorFactory}, overriding the default
 * LongIdentifierGenerator method to return a generator that starts at 100 instead of 1.</p>
 *
 * @author Commons-Uid team
 * @version $id$
 */
public class CustomIdentifierGeneratorFactory extends DefaultIdentifierGeneratorFactory {

    /**
	 * 
	 */
	private static final long serialVersionUID = -8756289503602020912L;

	/** Creates a new instance of CustomIdentifierGeneratorFactory */
    public CustomIdentifierGeneratorFactory() {
        super();
    }

    /**
     * <p>Gets a new {@link LongIdentifierGenerator} that generates
     * a sequence of Long objects increasing in value.</p>
     *
     * <p>The sequence will wrap when the maximum <code>long</code> value is
     * reached and return negative numbers. It will start from 100.</p>
     *
     * @return a new LongIdentifier with wrapping behavior
     */
    public LongIdentifierGenerator longGenerator() {
        return new LongGenerator(true, 100L);
    }
}
